home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Utilities / Disk / CMInstall / CLIMasterII / CLIMaster < prev   
Encoding:
Text File  |  1998-06-24  |  10.0 KB  |  451 lines

  1. G4C  ;$VER: CliMaster 2.5 (22.06.97)
  2.  
  3. winbig -1 -1 530 145 "CLI-MasterII © G.Maddox 1997  v2.5"
  4. winsmall 65 11 530 145
  5. wintype 11110001
  6. varpath "requester.g/routine.g/functions.g/*/config.g/hotdir.g/favorite.g/hunt.g"
  7.  
  8. xonload
  9. set output "con:0/11/640/200/Cli-Master II Output/auto/close"
  10. if $$g4c.version < 32
  11.     ezreq "I need at least\nversion 3.2 of Gui4Cli" Okay ""
  12.     stop
  13. endif
  14. extract climaster guipath cmst_guipth
  15. assign CMST: $cmst_guipth
  16. delvar cmst_guipth
  17. ttget :climaster
  18. if $ICONSTART = YES
  19.     setgad climaster 7 on
  20. else
  21.     guiopen climaster
  22. endif
  23. guiload cmst:modules/requester.g
  24. lvuse climaster $cm_srce
  25.  
  26. xonopen
  27. setgad climaster 7 off
  28.  
  29. xonclose
  30. setgad climaster 7 on
  31.  
  32. xonkey #5
  33. xonkey #8
  34. xonkey #18
  35. xonkey z
  36. gosub climaster stretchbuf 2 70 0 350       ;left
  37. xonkey x
  38. gosub climaster stretchbuf 2 210 0 210      ;centre
  39. xonkey c
  40. gosub climaster stretchbuf 2 350 0 70       ;right
  41.  
  42. xondiskin
  43. lvuse climaster $cm_dest
  44. if $$lv.dir = ''
  45.     lvdir refresh
  46. endif
  47. lvuse climaster $cm_srce
  48. if $$lv.dir = ''
  49.     lvdir refresh
  50. endif
  51.  
  52. xappicon 0 0 :climaster CLI-Master cm_goto off
  53. gadid 7
  54. guiopen climaster
  55. update climaster 8 "Welcome Back!!"
  56. if $cm_goto > ''
  57.     gosub climaster godir
  58.     gosub climaster update
  59.     gosub climaster addpath
  60. endif
  61.  
  62. xappwindow cm_goto
  63. if $cm_goto > ''
  64.     gosub climaster godir
  65.     gosub climaster update
  66.     gosub climaster addpath
  67. endif
  68.  
  69. box 0 13 320 12 out button
  70. box 200 25 20 12 out button
  71.  
  72. ;------------------------------------------------------------- Events
  73.  
  74. xlistview 0 37 210 110 "" cm_select "" 0 dir
  75. gadid 1
  76. gadhelp '$ll'
  77. gadfont topaz.font 8 000
  78. gosub routine.g filetype
  79. xlvhook 1
  80. gosub climaster update
  81. xlvdirhook 1
  82. gosub climaster update
  83. gosub climaster addpath
  84.  
  85. xlistview 210 37 210 110 "" cm_select "" 0 dir
  86. gadid 2
  87. gadhelp '$rl'
  88. gadfont topaz.font 8 000
  89. gosub routine.g filetype
  90. xlvhook 2
  91. gosub climaster update
  92. xlvdirhook 2
  93. gosub climaster update
  94. gosub climaster addpath
  95.  
  96. xtextin 20 0 245 13 "" cm_srcedir "" 512
  97. gadid 3
  98. gadhelp "Shows the LEFT lister's path. Paths can be typed in here."
  99. lvuse climaster 1
  100. lvdir #$cm_srcedir
  101. gosub climaster update
  102.  
  103. xtextin 285 0 245 13 "" cm_srcedir "" 512
  104. gadid 4
  105. gadhelp "Shows the RIGHT lister's path. Paths can be typed in here."
  106. lvuse climaster 2
  107. lvdir #$cm_srcedir
  108. gosub climaster update
  109.  
  110. text 0 0 20 13 "" 1 box
  111. gadid 5
  112. gadfont topaz.font 8 010
  113.  
  114. text 265 0 20 13 "" 1 box
  115. gadid 9
  116. gadfont topaz.font 8 010
  117.  
  118. xlistview 420 37 110 110 "" cm_mode "" 0 txt
  119. gadid 6
  120. gadhelp 'The FUNCTIONS perform various actions on selected files.'
  121. gadfont topaz.font 8 000
  122. lvuse climaster $cm_srce
  123. if $cm_mode == "getsize"
  124.     gosub climaster nosource
  125.     lvaction size cm_temp
  126.     update climaster 8 "Total Selected: $cm_temp Bytes."
  127.     stop
  128. elseif $cm_mode == "newcli"
  129.     cd sys:
  130.     cli 'newshell con:0/11/640/200/AmigaShell/auto/close from s:shell-startup'
  131.     stop
  132. elseif $cm_mode == "run"
  133.     gosub climaster nofile
  134.     gosub routine.g filetype
  135.     lvdir none
  136.     stop
  137. elseif $cm_mode == "execute"
  138.     gosub climaster nofile
  139.     cli 'c:execute $cm_select'
  140.     lvdir none
  141.     stop
  142. else
  143.     gosub climaster update
  144.     gosub climaster nosource
  145.     gosub functions.g functs
  146. endif
  147.  
  148. text 10 13 300 12 "" 60 nobox
  149. gadid 8
  150.  
  151. xbutton 0 25 40 12 Dev                 ;Vol 1
  152. gadfont topaz.font 8 010
  153. gadhelp 'This produces a Device List in the LEFT lister.'
  154. lvuse climaster 1
  155. lvdir disks
  156. gosub climaster update
  157.  
  158. xbutton 40 25 20 12 :                  ;root 1
  159. gadfont topaz.font 8 010
  160. gadhelp 'Sends the LEFT lister to the ROOT directory.'
  161. lvuse climaster 1
  162. lvdir root
  163. gosub climaster update
  164. gosub climaster addpath
  165.  
  166. xbutton 60 25 20 12 /                  ;parnt 1
  167. gadfont topaz.font 8 010
  168. gadhelp 'Sends the LEFT lister to the PARENT directory.'
  169. lvuse climaster 1
  170. lvdir parent
  171. gosub climaster update
  172. gosub climaster addpath
  173.  
  174. xbutton 80 25 40 12 All                ;all 1
  175. gadhelp 'SELECT ALL files and directories in the LEFT lister.'
  176. lvuse climaster 1
  177. lvdir all
  178. gosub climaster update
  179.  
  180. xbutton 120 25 40 12 None              ;none 1
  181. gadhelp 'DE-SELECT ALL files and directories in the LEFT lister.'
  182. lvuse climaster 1
  183. lvdir none
  184. gosub climaster update
  185.  
  186. xbutton 160 25 40 12 Refr              ;refresh 1
  187. gadhelp 'REFRESH the contents of the LEFT lister.'
  188. lvuse climaster 1
  189. lvdir refresh
  190. gosub climaster update
  191.  
  192. xbutton 220 25 40 12 Dev               ;Vol 2
  193. gadfont topaz.font 8 010
  194. gadhelp 'This produces a Device List in the RIGHT lister.'
  195. lvuse climaster 2
  196. lvdir disks
  197. gosub climaster update
  198.  
  199. xbutton 260 25 20 12 :                 ;root 2
  200. gadfont topaz.font 8 010
  201. gadhelp 'Sends the RIGHT lister to the ROOT directory.'
  202. lvuse climaster 2
  203. lvdir root
  204. gosub climaster update
  205. gosub climaster addpath
  206.  
  207. xbutton 280 25 20 12 /                 ;parnt 2
  208. gadfont topaz.font 8 010
  209. gadhelp 'Sends the RIGHT lister to the PARENT directory.'
  210. lvuse climaster 2
  211. lvdir parent
  212. gosub climaster update
  213. gosub climaster addpath
  214.  
  215. xbutton 300 25 40 12 All               ;all 2
  216. gadhelp 'SELECT ALL files and directories in the RIGHT lister.'
  217. lvuse climaster 2
  218. lvdir all
  219. gosub climaster update
  220.  
  221. xbutton 340 25 40 12 None              ;none 2
  222. gadhelp 'DE-SELECT ALL files and directories in the RIGHT lister.'
  223. lvuse climaster 2
  224. lvdir none
  225. gosub climaster update
  226.  
  227. xbutton 380 25 40 12 Refr              ;refresh 2
  228. gadhelp 'REFRESH the contents of the RIGHT lister.'
  229. lvuse climaster 2
  230. lvdir refresh
  231. gosub climaster update
  232.  
  233. xbutton 420 25 20 12 <                ;<--
  234. gadfont topaz.font 8 010
  235. gadhelp 'EXPAND the RIGHT lister for easier viewing.'
  236. gosub climaster stretchbuf 2 70 0 350       ;left
  237.  
  238. xbutton 440 25 30 12 ><               ;>|<
  239. gadfont topaz.font 8 010
  240. gadhelp 'NORMALIZE both listers.'
  241. gosub climaster stretchbuf 2 210 0 210      ;centre
  242.  
  243. xbutton 470 25 20 12 >                ;-->
  244. gadfont topaz.font 8 010
  245. gadhelp 'EXPAND the LEFT lister for easier viewing.'
  246. gosub climaster stretchbuf 2 350 0 70       ;right
  247.  
  248. xbutton 490 25 40 12 S=D           ;copybuf
  249. gadhelp 'Copies the contents of the SOURCE to the DESTINATION.'
  250. cm_destdir = $cm_srcedir
  251. if $cm_srce = 1
  252.     lvuse climaster 2
  253.     lvdir #$cm_srcedir
  254.     update climaster 4 $cm_srcedir
  255. elseif $cm_srce = 2
  256.     lvuse climaster 1
  257.     lvdir #$cm_srcedir
  258.     update climaster 3 $cm_srcedir
  259. endif
  260. lvuse climaster $cm_srce
  261. gosub climaster update
  262.  
  263. xarea 200 25 20 12 none                ;switch S/D
  264. gadkey " "
  265. gadhelp 'SWAP the SOURCE and DESTINATION. Hotkey = Spacebar.'
  266. if $cm_srce = 1
  267.     lvuse climaster 2
  268. elseif $cm_srce = 2
  269.     lvuse climaster 1
  270. endif
  271. gosub climaster update
  272.  
  273. xbutton 320 13 30 12 #?
  274. gadhelp 'Select files by PATTERN. Do not enter the "#?"'
  275. gosub climaster nosource
  276. guiopen routine.g
  277.  
  278. xbutton 350 13 60 12 _HotDir            ;hotdir
  279. gadhelp 'Opens the HOTDIR window for fast moving around.'
  280. guiopen hotdir.g
  281.  
  282. xbutton 410 13 40 12 _User              ;usrbut
  283. gadhelp 'Opens the USER COMMAND window.'
  284. guiload cmst:modules/usrcomm.g
  285.  
  286. xbutton 450 13 80 12 _Favourite          ;favourites
  287. gadhelp 'Opens the FAVOURITES path list.'
  288. guiload cmst:modules/favorite.g
  289.  
  290. ;-------------------------------------------------------------- Menus
  291.  
  292. xmenu "Project" "About" "" A
  293. guiload cmst:modules/about.g
  294.  
  295. xmenu "Project" "Help..." "" H
  296. guiload cmst:modules/cmhelp.g
  297.  
  298. xmenu "Project" "Iconify " "" I
  299. ifexists window routine.g
  300.     guiclose routine.g
  301. endif
  302. guiclose climaster
  303.  
  304. xmenu "Project" barlabel "" ""
  305.  
  306. xmenu "Project" "Quit" "" Q
  307. cli 'resident filenote remove'
  308. cli 'resident copy remove'
  309. cli 'resident list remove'
  310. assign CMST: remove
  311. guiquit routine.g
  312. guiquit functions.g
  313. guiquit hotdir.g
  314. guiquit runreq.g
  315. guiquit dms.g
  316. ifexists window sfxinfo
  317.     gosub sfxinfo stopmod
  318. endif
  319. guiquit sfxinfo
  320. guiquit climaster
  321.  
  322. xmenu "Disk" "Format" "" F
  323. guiload cmst:modules/format.g
  324.  
  325. xmenu "Disk" "Disk Copy " "" D
  326. guiload cmst:modules/dcopy.g
  327.  
  328. xmenu "Disk" "Install" "" B
  329. cm_mode = "install"
  330. guiload cmst:modules/relab.g
  331.  
  332. xmenu "Disk" "Relabel" "" R
  333. cm_mode = "relab"
  334. guiload cmst:modules/relab.g
  335.  
  336. xmenu "Disk" barlabel "" ""
  337.  
  338. xmenu "Disk" "Print Dir" "" P
  339. lvsave t:tempfile
  340. copy t:tempfile prt:
  341. delete t:tempfile
  342.  
  343. xmenu Settings "Configuration" "" C
  344. guiload cmst:modules/config.g
  345.  
  346. xmenu Settings "Function Ed" "" E
  347. guiload cmst:modules/fled.g
  348.  
  349. xmenu Settings "User Commands" "" U
  350. guiload cmst:modules/user.g
  351.  
  352. ;----------------------------------------------------------- Routines
  353.  
  354. xroutine update
  355. update climaster 8 ""
  356. cm_srce = $$lv.id
  357. if $cm_srce = 1
  358.     cm_dest = 2
  359.     ll = 'This is the current SOURCE lister.'
  360.     rl = 'This is the current DESTINATION lister.'
  361.     update climaster 3 $$lv.dir
  362.     update climaster 5 "S"
  363.     update climaster 9 ""
  364. else
  365.     cm_dest = 1
  366.     rl = 'This is the current SOURCE lister.'
  367.     ll = 'This is the current DESTINATION lister.'
  368.     update climaster 4 $$lv.dir
  369.     update climaster 5 ""
  370.     update climaster 9 "S"
  371. endif
  372. lvuse climaster $cm_dest
  373. cm_destdir = $$lv.dir
  374. lvuse climaster $cm_srce
  375. cm_srcedir = $$lv.dir
  376.  
  377. xroutine addpath
  378. if $cm_srcedir > ""
  379.     lvuse hotdir.g 1
  380.     lvsearch $cm_srcedir ci first
  381.     if $$lv.rec != $cm_srcedir
  382.         lvadd $cm_srcedir
  383.     endif
  384.     lvuse climaster $cm_srce
  385. endif
  386.  
  387. xroutine stretchbuf
  388. changearg climaster 1 $$arg.0 $$arg.1
  389. changearg climaster 2 $$arg.2 $$arg.1
  390. changearg climaster 2 $$arg.0 $$arg.3
  391. partredraw climaster 0 37 420 106
  392.  
  393. xroutine nosource
  394. if $cm_srcedir = ""
  395.     update climaster 8 "No Source Directory!"
  396.     stop
  397. endif
  398.  
  399. xroutine nodest
  400. if $cm_destdir = ""
  401.     update climaster 8 "No Target Directory!"
  402.     stop
  403. endif
  404.  
  405. xroutine nofile
  406. lvmulti first
  407. if $cm_select = ""
  408.     update climaster 8 "No File(s) Selected."
  409.    stop
  410. endif
  411.  
  412. xroutine godir
  413. ifexists DOS $cm_goto
  414. orifexists DIR $cm_goto
  415.     lvuse climaster $cm_srce
  416.     lvdir #$cm_goto
  417.     return
  418. elseifexists FILE $cm_goto
  419.     extract cm_goto path cm_aptmp
  420.     lvuse climaster $cm_srce
  421.     lvdir #$cm_aptmp
  422.     extract cm_goto file cm_aptmp
  423.     lvfind $cm_aptmp
  424. endif
  425.  
  426. ;--------------------------------------------
  427.  
  428. newfile sfxinfo
  429.  
  430. winbig -1 0 290 12 " Playing Module..."
  431. wintype 01010000
  432. varpath "climaster/*/routine.g"
  433.  
  434. xonopen
  435. guiwindow climaster on
  436.  
  437. text 0 0 240 12 "" 30 box
  438. gadid 1
  439.  
  440. xbutton 240 0 50 12 Stop
  441. gosub sfxinfo stopmod
  442.  
  443. xroutine stopmod
  444. cli '$STOPMUSIC'
  445. update sfxinfo 1 ""
  446. ifexists gui climaster
  447.     guiclose sfxinfo
  448. else
  449.     guiquit sfxinfo
  450. endif
  451.